<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html manifest="manifest.appcache" xmlns="http://www.w3.org/1999/xhtml">
    <head>
		<?php
			@SESSION_START(); 
			include('model/main.php');
			os::gzip();
		?>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta content="DESIGN BY CUONGIT1981" ><meta name="description" content="CỬA HÀNG"/>
		<meta name="keywords" content="CỬA HÀNG"/>
		<meta name="description" content="CỬA HÀNG" />
		<meta property="og:url" content="CỬA HÀNG" />
		<title>SHOPPING365.VN - CỬA HÀNG <?php echo $_SESSION['shop'][3]." - ".$_SESSION['shop'][7] ; ?> </title>
		<link rel="shortcut icon" href="/images/365.JPG" />
		<script type="text/javascript" src="js/main.js" ></script>
		<link rel="stylesheet" type="text/css" media="screen" href="css/cuahang.css" />
		<script src="js/jquery-1.11.0.js" type="text/javascript"></script>
		<script src="js/jquery-1.11.0.min.js" type="text/javascript"></script>
		<script type="text/javascript" src="js/jquery-1.3.2.js"></script>	  
		<link rel="stylesheet" type="text/css" href="lib/imgmove/css/component.css" />
		<script src="lib/imgmove/js/modernizr.custom.js"></script>
		
		<link href="lib/themes/generic.css" rel="stylesheet" type="text/css" />
		<link href="lib/themes/3/slider.css" rel="stylesheet" type="text/css" />
		<script src="lib/themes/3/thumbnail-slider.js" type="text/javascript"></script>
		
		<link href="lib/themes/2/js-image-slider.css" rel="stylesheet" type="text/css" />
		<script src="lib/themes/2/js-image-slider.js" type="text/javascript"></script>
		 <link href="lib/themes/generic.css" rel="stylesheet" type="text/css" />
	
		<div id="fb-root"></div>
		<style>
			.zoom {
				display:inline-block;
				position: relative;
			}
			.zoom img {
				display: block;
			}
			.zoom img::selection { background-color: transparent; }
		</style>
		<script>(function(d, s, id) {
			  var js, fjs = d.getElementsByTagName(s)[0];
			  if (d.getElementById(id)) return;
			  js = d.createElement(s); js.id = id;
			  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
			  fjs.parentNode.insertBefore(js, fjs);
			}(document, 'script', 'facebook-jssdk'));
		</script>
		<script src='js/jquery.zoom.js'></script>
		<?php
			$shop = query::shop($_REQUEST['id']);
			$khuvuc = $shop[8] ;
			$loaishop =  explode('_',$shop[9]);
			$tkid = $shop[1] ;
			$tenchuyenmuc = convertViText::getChuyenmucName($loaishop[0]);
			$nhomsp = convertViText::getNhomsp($loaishop[0]);
			$loaisp = convertViText::vietHoa($loaishop[1]);
			if($shop != null ){
				
				function get_infor_from_address($address = null) {
					$prepAddr = str_replace(' ', '+', stripUnicode($address));
					$geocode = file_get_contents('http://maps.google.com/maps/api/geocode/json?address='.$prepAddr.'&sensor=false');
					$output = json_decode($geocode);
					return $output;
				}
				function stripUnicode($str){
					if(!$str) return false;
					$unicode = array(
						'a'=>'á|à|ả|ã|ạ|ă|ắ|ặ|ằ|ẳ|ẵ|â|ấ|ầ|ẩ|ẫ|ậ|Á|À|Ả|Ã|Ạ|Ă|Ắ|Ặ|Ằ|Ẳ|Ẵ|Â|Ấ|Ầ|Ẩ|Ẫ|Ậ',
						'd'=>'đ|Đ',
						'e'=>'é|è|ẻ|ẽ|ẹ|ê|ế|ề|ể|ễ|ệ|É|È|Ẻ|Ẽ|Ẹ|Ê|Ế|Ề|Ể|Ễ|Ệ',
						'i'=>'í|ì|ỉ|ĩ|ị|Í|Ì|Ỉ|Ĩ|Ị',
						'o'=>'ó|ò|ỏ|õ|ọ|ô|ố|ồ|ổ|ỗ|ộ|ơ|ớ|ờ|ở|ỡ|ợ|Ó|Ò|Ỏ|Õ|Ọ|Ô|Ố|Ồ|Ổ|Ỗ|Ộ|Ơ|Ớ|Ờ|Ở|Ỡ|Ợ',
						'u'=>'ú|ù|ủ|ũ|ụ|ư|ứ|ừ|ử|ữ|ự|Ú|Ù|Ủ|Ũ|Ụ|Ư|Ứ|Ừ|Ử|Ữ|Ự',
						'y'=>'ý|ỳ|ỷ|ỹ|ỵ|Ý|Ỳ|Ỷ|Ỹ|Ỵ',
					);
					foreach($unicode as $nonUnicode=>$uni) $str = preg_replace("/($uni)/i",$nonUnicode,$str);
					return $str;
				}  
				$address = get_infor_from_address($shop[3]." - ".$shop[8]);
				$x = $address->results[0]->geometry->location->lat ;
				$y = $address->results[0]->geometry->location->lng ;
				$adr = $shop[2]." - ".$shop[3]." - ".$shop[8]; 
			}
		?>
		<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&language=vi"></script>
		<script>
			js = new controls();
			setInterval("js.clock()",1000);		

			var map;
			function initialize() {
				var myLatlng = new google.maps.LatLng(<?php echo json_encode($x); ?>,<?php echo json_encode($y); ?>);
				var mapOptions = {
					zoom: 15,
					center: myLatlng,
					mapTypeId: google.maps.MapTypeId.ROADMAP
				};
				map = new google.maps.Map(document.getElementById('map-canvas'),mapOptions);
				var text;
				text= "<div style='color:#000;font-weight:100;text-align:center;padding:10px;width:600px;'> "+<?php echo json_encode($adr); ?>+" </div>";
				var infowindow = new google.maps.InfoWindow({ content: text,
						size: new google.maps.Size(1000,1000),
						position: myLatlng
				});
				infowindow.open(map);    
				var marker = new google.maps.Marker({
					  position: myLatlng,
					  map: map,
					  title:"MAP !"
				});
			}		
			google.maps.event.addDomListener(window, 'load', initialize);		
		</script>
		<script type="text/javascript">
			/*var message="NoRightClicking"; function defeatIE() {if (document.all) {(message);return false;}} function defeatNS(e) {if (document.layers||(document.getElementById&&!document.all)) { if (e.which==2||e.which==3) {(message);return false;}}} if (document.layers) {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=defeatNS;} else{document.onmouseup=defeatNS;document.oncontextmenu=defeatIE;} document.oncontextmenu=new Function("return false") */
		</script>
	<body>
	<?php
		if($shop){
	?>
			<div class="wrapper"><img id="wallpaper" src="images/a8.jpg" alt="" width="100%" style="padding:0;margin:0;float:left"/></div>
			<div class="left-menu">
				<ul>
					<li><a href="javascript:" onclick="js.cuahang('trangchu');">BẢN ĐỒ</a></li>
					<li><a href="javascript:" onclick="js.cuahang('sanpham');">SẢN PHẨM</a></li>
					<li><a href="javascript:" onclick="js.cuahang('xemthem');" title="XEM THÊM">XEM THÊM</a></li>					<li><a href="javascript:" onclick="js.cuahang('comment');">COMMENT</a></li>
					<li><a href="javascript:" onclick="js.cuahang('lienhe');">LIÊN HỆ</a></li>
				</ul>
			</div>
			<div class="content-cuahang">
				<center>
					<div class="contain">
						<div class="body">
							<h2><a><?php echo $shop[2] ; ?></a></h2>&nbsp;&nbsp;
							<span>
								<a><?php echo $tenchuyenmuc.' - '.$nhomsp.$loaisanpham ; ?></a>&nbsp;&nbsp;					
								<a href="javascript:" onclick="js.ref(<?php echo $shop[0] ; ?>,'map')"><?php echo $shop[3]." - ".$shop[8] ; ?> </a>	&nbsp;	&nbsp;
								<a >Điên Thoại : <?php echo $shop[5] ; ?></a>	
							</span>
						</div>				
						<div id="sanpham" >
							<center>
								<div style="width:1020px;padding-top:30px;position:relative;clear:both;text-align:center;
									-webkit-animation: appear 0.6s ease-in-out 1s backwards;
									-moz-animation: appear 0.6s ease-in-out 1s backwards;
									-o-animation: appear 0.6s ease-in-out 1s backwards;
									-ms-animation: appear 0.6s ease-in-out 1s backwards;
									animation: appear 0.6s ease-in-out 1s backwards;">

									<ul id="elasticstack" class="elasticstack">		
									<?php 
											$shopProduct = query::shopProducts($loaishop[0],$id);	
											if($shopProduct){
												$count = 0;
												foreach($shopProduct as $x){
										?>
													<li >
														<img title="double click để xem chi tiết , move ảnh để xem tiếp ." width="300px" alt="" src="<?php echo config::getURL(); ?>images/thoitrang/ao/<?php echo $x[2] ;?>"  ondblclick="js.ref('<?php echo $loaishop[0].'_'.$x[0] ; ?>','sanpham');" /><p>Giá : <?php echo convert::price($x[6]); ?></p>
													</li>
										<?php
													++$count;
												}
											} else {
										?>	
												
										<?php
											}
										?>
									</ul>
									<script src="<?php echo config::getURL(); ?>lib/imgmove/js/draggabilly.pkgd.min.js"></script>
									<script src="<?php echo config::getURL(); ?>lib/imgmove/js/elastiStack.js"></script>
									<script>new ElastiStack( document.getElementById( 'elasticstack' ) );</script>
									<div style="width:320px;padding-left:0;position:absolute !important;top:420px !important;color:orange;font-size:20px;text-shadow:0px 1px 3px #000;"><marquee onmouseover="this.stop()" onmouseout="this.start()" scrollamount="3.5" direction="left" width="100%" height="200" align="center"> DÙNG CHUỘT MOVE ẢNH ĐỂ XEM SẢN PHẨM . DOUBLE CLICK CHUỘT NẾU MUỐN XEM CHI TIẾT SẢN PHẨM !</marquee></div>
									 <div class="div2">
										<div id="mcts1">
											<?php
												$shops  = null ;
												$shops = query::shops(strtolower($shop[9]));
												if($shops!=null){
													#SHOW ITERATOR SHOP
													foreach($shops as $x){
														if($x[8] === $khuvuc){ 
											?>														
															<div class="each">
																<img src="images/cuahang/logo/<?php echo $x[4]; ?>" alt="<?php echo $x[2]; ?>"  width="250px" height="164px" href="javascript:" ondblclick="js.ref('<?php echo $x[0]; ?>','shop');" title="DOUBLE CLICK ĐỂ XEM CỬA HÀNG"/>
																<div class="content" style="font-family: 'BebasNeueRegular', 'Arial Narrow', Arial, sans-serif;font-weight:100;font-size:15px;color:orange;">
																	<p style="position:relative;padding:5px 0;color:#ccc;font-size:28px;"><strong ><?php echo $x[2]; ?></strong></p>
																	<p style="position:relative;padding:5px 0;color:#a00;"><?php echo $x[3]." - ".$x[8] ?></p>																
																	<ul>
																		<li><?php echo $x[11]; ?></li>
																	</ul>
																</div>
															</div>
											<?php 		}
													}
												} 
											?>		
										</div>  
									</div> 
								</div>	
							</center>
						</div>
						<div class="shopmap">				
							<div id="map-canvas" style="height:100%;width:100%;position:fixed;top:0;left:0;opacity:0.7;-webkit-animation: appear 5s ease-in-out 5s backwards;-moz-animation: appear 5s ease-in-out 5s backwards;"></div>
						</div>
						<div id="xemthem">
							<div style="position:absolute;top:20px;">	
								 <div id="sliderFrame">
									<div id="slider">
									<?php			
										$sOB  = null ;
										$sOB = query::shopsOfBoss($tkid);
										if($sOB!=null){
											#SHOW ITERATOR SHOP
											foreach($sOB as $x){					
									?>			
												<img class="lazyImage" onclick="js.ref('<?php echo $x[0]; ?>','shop');" src="images/cuahang/logo/<?php echo $x[4]; ?>" alt="<?php echo $x[2]." - ".$x[3]." - ".$x[8]; ?>"  width="250px" height="164px" onclick="js.ref('<?php echo $x[0]; ?>','shop');" title="CLICK ĐỂ XEM CỬA HÀNG"/>								
									<?php 		
											} 
										} 
									?>		
									</div>
									<!--thumbnails-->
									<div id="thumbs">
									<?php			
										$sOB  = null ;
										$sOB = query::shopsOfBoss($tkid);
										if($sOB!=null){
											#SHOW ITERATOR SHOP
											foreach($sOB as $x){					
									?>			
											<div class="thumb">
												<div class="frame"><img src="images/cuahang/logo/<?php echo $x[4]; ?>" alt="<?php echo $x[2]." - ".$x[3]." - ".$x[8]; ?>"  width="250px" height="164px" />	</div>
												<div class="thumb-content">
													<b style="color:#eee;font-size:24px;"><?php echo $x[2]; ?></b><br/>
													<?php echo $x[3]." - ".$x[8]; ?><br/>
													<?php echo $x[11]; ?>
												</div>
												<div style="clear:both;"></div>
											</div>													
									<?php 		
											} 
										} 
									?>		
									</div>
									<!--clear above float:left elements. It is required if above #slider is styled as float:left. -->
									<div style="clear:both;height:0;"></div>
								</div>				
							</div>
						</div>
						<div id="comment">
							<?php 
								if($shop !=null){
									$accShop = null;
									$accShop = data::getaccounts($shop[1]);		
									if($accShop!=null){
							?>
										<div class="commentfacebook" style="color:#000;width:1040px;padding-top:20px;text-align:left;margin:5px;">
											<div style="float:left;position:absolute !important;" class="fb-share-button" data-href="https://www.facebook.com/<?php echo $accShop[3]; ?>" data-width="60px" data-type="button"> </div> &nbsp;  &nbsp;
											<div style="float:left;position:absolute !important;padding-left:50px;" class="fb-like" data-href="https://www.facebook.com/<?php echo $accShop[3]; ?>" data-width="50px" data-layout="button" data-action="like" data-show-faces="true" data-share="false"> </div>&nbsp;  &nbsp;
											<p class="fb-comments" data-href="https://www.facebook.com/<?php echo $accShop[3]; ?>" data-width="1040px" data-numposts="50" data-colorscheme="dark" style="font-size:11px;color:#000 !important;overflow-y:scroll;overflow-x:hidden;max-height:400px;border-radius:1px;box-shadow:0px 1px 2px #000"></p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;		
										</div>

							<?php
									}
								} 
							?>
						</div>
						<div id="lienhe" >
							<h1 style="padding:30px 20px;color:#000;">LIÊN HỆ : <?php echo $shop[5] ; ?> </h1>
						</div>
						<p class="banner">
							<a href="http://www.shopping365.vn" title="TRANG CHỦ">SHOPPING 365<b style="font-size:50px;color:orange">.VN</b></a>
						</p>
					</div>
				</center>
			</div>
		<?php
			} else include("loiduongdan.php");
		?>
	</body>
</html>